import type { RouteParamValueRaw } from "#vue-router";
import { useRouteParams } from "@vueuse/router";

/**
 * 获取路由参数Params
 * @param name 参数名
 * @param defaultVal 默认值
 */
export default function useAppRouteParams<T extends RouteParamValueRaw>(name: string, defaultVal?: T) {
    return useRouteParams<T>(name, defaultVal, { mode: 'push' });
}